package com.klangner.animation.path
{
  import com.klangner.animation.path.api.IPath;
  
  import flash.geom.Point;
  
  
  public class VerticalSpringPath implements IPath
  {
    private var _centerX:Number;
    private var _centerY:Number;
    private var _angle:Number = 0;
    private var _speed:Number = 0.1;
    private var _radius:Number = 50;
    private var _position:Point = new Point();
    
    
    public function VerticalSpringPath(centerX:Number, centerY:Number, radius:Number){
      _centerX = centerX;
      _centerY = centerY;
      _radius = radius;
    }

    public function move():void{
      
      _position.x = _centerX;
      _position.y = _centerY + Math.sin(_angle) * _radius;
      
      _angle += _speed;
    }
    
    public function get position():Point{
      
      return new Point(_position.x, _position.y);
    }
    
    public function get angle():Number{
      
      return 0;
    }
    
}
}